import App from './App'

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import api from './common/js/api.js'
import store from './store/store.js'
export function createApp() {
  const app = createSSRApp(App)
  
  // 全局提示
  app.config.globalProperties.$toast=msg=>{
  	  uni.showToast({
  	  	title:msg,
  		icon:'none',
  		duration:2000
  	  })
  }
  
  // 路由跳转
  app.config.globalProperties.$go=url=>{
  	  uni.navigateTo({
  	  	url
  	  })
  }
  
  // 请求api
  app.config.globalProperties.$api=api
  
  // 注册vuex
  app.use(store)
  
  return {
    app
  }
}
// #endif